package fischl.model;

import fischl.RoomLoader;

import java.util.*;

public final class Room {
  public String name;
  public String upId;//在斗鱼中是upid，在虎牙中是聊天id
  public long roomId;
  public String liveRoom;
  public String playback;

  public static List<Room> loadAll() {
    return RoomLoader.load();
  }

  public static Room getByUpId(String upId) {
    List<Room> list = loadAll();
    for (Room room : list) {
      if (room.upId.equals(upId)) {
        return room;
      }
    }
    return null;
  }
}
